WORKFLOW_DIR=$(dirname "$(realpath "$0")")
cd "$WORKFLOW_DIR"/../../scripts
pwd

SCRIPT_DIR=$(dirname "$(realpath "$0")")
PROJECT_DIR=$(realpath "$SCRIPT_DIR"/../)
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7

mkdir -p ${PROJECT_DIR}/outputs

echo "start sh run_Videolm_pretrain.sh----------------------------"
sh run.sh \
    --train_stage "VideoLM_PT" \
    --model_size 1B-dense \
    --learning_rate 4e-4 \
    --num_warmup_steps 0 \
    --num_train_epochs 1 \
    --max_seq_len 640 \
    --data_path "${PROJECT_DIR}/resource/dataset/minimind2-video/video_data_1.jsonl" \
    --images_path "${PROJECT_DIR}/resource/dataset/minimind2-video/pretrain_videos_feature" \
    --images_lmdb_path None \
    --load_ckpt_path "${PROJECT_DIR}/../model/ckpt/SFT_2048.pth" \
    --save_dir ${PROJECT_DIR}/outputs/tmp1 \
    --train_micro_batch_size_per_gpu 1 \
    --gradient_accumulation_steps 1 \
    --zero_stage 1 \

wait
echo "start sh run_Videolm_sft.sh----------------------------"
sh run.sh \
    --train_stage "VideoLM_SFT"  \
    --model_size 1B-dense  \
    --learning_rate 5e-5 \
    --num_warmup_steps 0 \
    --num_train_epochs 30 \
    --max_seq_len 1536 \
    --data_path "${PROJECT_DIR}/resource/dataset/minimind2-video/video_data_1.jsonl" \
    --images_path "${PROJECT_DIR}/resource/dataset/minimind2-video/pretrain_videos_feature" \
    --images_lmdb_path None \
    --load_ckpt_path "" \
    --save_dir tmp4 \
    --train_micro_batch_size_per_gpu 1 \
    --gradient_accumulation_steps 1 \
    --zero_stage 1 \
